package com.itheima.AtomicInteger;

import java.util.concurrent.atomic.AtomicInteger;

public class AtomicIntegerDemo {
    public static void main(String[] args) {
        AtomicInteger ato = new AtomicInteger(0);
        for (int j = 0; j < 100; j++) {
            new Thread(()->{
                for (int i = 0; i < 100; i++) {

                    int count = ato.incrementAndGet();
                    System.out.println("已经送了" + count + "个冰淇淋");
                }
            }).start();
        }
    }
}
